package cn.liberals.system.service.impl;

import cn.liberals.basic.service.impl.BaseServiceImpl;
import cn.liberals.basic.utils.PageList;
import cn.liberals.org.domain.Employee;
import cn.liberals.org.mapper.EmployeeMapper;
import cn.liberals.org.service.IEmployeeService;
import cn.liberals.system.domain.Dictionarytype;
import cn.liberals.system.mapper.DictionarytypeMapper;
import cn.liberals.system.query.DictionarytypeQuery;
import cn.liberals.system.service.IDictionarytypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
// 只读事务
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class DictionarytypeServiceImpl extends BaseServiceImpl<Dictionarytype> implements IDictionarytypeService {

    @Autowired
    private DictionarytypeMapper dictionarytypeMapper;


    @Override
    public PageList<Dictionarytype> dictionaryTypeList(DictionarytypeQuery dictionarytypeQuery) {
        List<Dictionarytype> systemDictionaryTypes = dictionarytypeMapper.dictionarytypeList(dictionarytypeQuery);
        Integer totals = dictionarytypeMapper.queryCount(dictionarytypeQuery);
        return new PageList<Dictionarytype>(totals, systemDictionaryTypes);
    }
}
